home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / inptmthd.sit / Input Methods / card_4689.txt < prev    next >
Text File  |  1989-11-24  |  6KB  |  284 lines

  1. -- card: 4689 from stack: in
  2. -- bmap block id: 4945
  3. -- flags: 0000
  4. -- background id: 2696
  5. -- name: Typing
  6. ----- HyperTalk script -----
  7. on openCard
  8.   newItem
  9.   pass openCard
  10. end openCard
  11.  
  12. on closeCard
  13.   resetCountDown
  14.   put empty into card field "Input"
  15.   pass closeCard
  16. end closeCard
  17.  
  18. -- Check if student is taking too long.
  19. on idle
  20.   global lastTime, count
  21.   if the seconds - lastTime > 0 then
  22.     add 1 to count
  23.     if count > 5 then
  24.       timesUp
  25.     else
  26.       put "Cover" && count into fName
  27.       hide card field fName
  28.       put the seconds into lastTime
  29.       select after line 1 of card field "Input"  -- put cursor back
  30.     end if
  31.   end if
  32.   pass idle
  33. end idle
  34.  
  35.  
  36. on timesUp
  37.   hide card field "Times Up Cover"
  38.   wrongSound
  39.   wait 40 ticks
  40.   show card field "Times Up Cover"
  41.   newItem
  42. end timesUp
  43.  
  44.  
  45. -- Make new list of item numbers ("1,2,3,4...")
  46. on newItemList
  47.   global itemList
  48.   repeat with i = 1 to number of lines in card field "Items"
  49.     put i & "," after itemList
  50.   end repeat
  51. end newItemList
  52.  
  53.  
  54. -- Pick a random item number from the list (without replacement)
  55. -- and use the corresponding line from the item field.
  56. on newItem
  57.   global itemList, curItem
  58.   if itemList is empty then
  59.     newItemList  -- ran out of items, start over
  60.   end if
  61.   put empty into card field "Input"
  62.   put random(number of items in itemList) into listPick
  63.   put item listPick of itemList into curItem
  64.   -- put itemList & " -> " & curItem  -- shows how itemList changes
  65.   delete item listPick of itemList
  66.   put line curItem of card field "Items" into card field "Word"
  67.   resetCountDown
  68.   unlock screen  -- make sure screen is unlocked so click will work
  69.   click at the location of card field "Input"
  70. end newItem
  71.  
  72.  
  73. on resetCountDown
  74.   global lastTime, count
  75.   lock screen
  76.   repeat with f = 1 to 5
  77.     put "Cover" && f into fName
  78.     show card field fName
  79.   end repeat
  80.   put 0 into count
  81.   put the seconds into lastTime
  82.   unlock screen
  83. end resetCountDown
  84.  
  85.  
  86. on author
  87.   set the visible of card field "Answers" to not the visible of card field "Answers"
  88.   set the visible of card field "Items" to not the visible of card field "Items"
  89. end author
  90.  
  91.  
  92.  
  93.  
  94. -- part 1 (field)
  95. -- low flags: 00
  96. -- high flags: 0002
  97. -- rect: left=45 top=150 right=170 bottom=232
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 0
  101. -- font id: 3
  102. -- text size: 14
  103. -- style flags: 0
  104. -- line height: 18
  105. -- part name: Input
  106. ----- HyperTalk script -----
  107. on returnInField
  108.   global curItem
  109.   if me = line curItem of card field "Answers" then
  110.     rightSound
  111.     newItem
  112.   else
  113.     wrongSound
  114.     delete line 1 of me
  115.   end if
  116. end returnInField
  117.  
  118.  
  119.  
  120.  
  121. -- part 2 (field)
  122. -- low flags: 80
  123. -- high flags: 0002
  124. -- rect: left=246 top=69 right=295 bottom=365
  125. -- title width / last selected line: 0
  126. -- icon id / first selected line: 0 / 0
  127. -- text alignment: 0
  128. -- font id: 3
  129. -- text size: 12
  130. -- style flags: 8192
  131. -- line height: 16
  132. -- part name: Items
  133.  
  134.  
  135. -- part 3 (field)
  136. -- low flags: 00
  137. -- high flags: 2001
  138. -- rect: left=38 top=61 right=114 bottom=259
  139. -- title width / last selected line: 0
  140. -- icon id / first selected line: 0 / 0
  141. -- text alignment: 0
  142. -- font id: 3
  143. -- text size: 12
  144. -- style flags: 0
  145. -- line height: 16
  146. -- part name: 
  147.  
  148.  
  149. -- part 4 (field)
  150. -- low flags: 01
  151. -- high flags: 2001
  152. -- rect: left=38 top=114 right=142 bottom=237
  153. -- title width / last selected line: 0
  154. -- icon id / first selected line: 0 / 0
  155. -- text alignment: 0
  156. -- font id: 3
  157. -- text size: 14
  158. -- style flags: 256
  159. -- line height: 18
  160. -- part name: Word
  161.  
  162.  
  163. -- part 5 (field)
  164. -- low flags: 80
  165. -- high flags: 0002
  166. -- rect: left=366 top=69 right=295 bottom=485
  167. -- title width / last selected line: 0
  168. -- icon id / first selected line: 0 / 0
  169. -- text alignment: 0
  170. -- font id: 3
  171. -- text size: 12
  172. -- style flags: 8192
  173. -- line height: 16
  174. -- part name: Answers
  175.  
  176.  
  177. -- part 7 (field)
  178. -- low flags: 01
  179. -- high flags: 0001
  180. -- rect: left=44 top=216 right=268 bottom=243
  181. -- title width / last selected line: 0
  182. -- icon id / first selected line: 0 / 0
  183. -- text alignment: 0
  184. -- font id: 3
  185. -- text size: 12
  186. -- style flags: 0
  187. -- line height: 16
  188. -- part name: Times Up Cover
  189.  
  190.  
  191. -- part 8 (field)
  192. -- low flags: 01
  193. -- high flags: 0001
  194. -- rect: left=45 top=183 right=205 bottom=73
  195. -- title width / last selected line: 0
  196. -- icon id / first selected line: 0 / 0
  197. -- text alignment: 0
  198. -- font id: 3
  199. -- text size: 12
  200. -- style flags: 0
  201. -- line height: 16
  202. -- part name: Cover 1
  203.  
  204.  
  205. -- part 9 (field)
  206. -- low flags: 01
  207. -- high flags: 0001
  208. -- rect: left=73 top=183 right=205 bottom=111
  209. -- title width / last selected line: 0
  210. -- icon id / first selected line: 0 / 0
  211. -- text alignment: 0
  212. -- font id: 3
  213. -- text size: 12
  214. -- style flags: 0
  215. -- line height: 16
  216. -- part name: Cover 2
  217.  
  218.  
  219. -- part 10 (field)
  220. -- low flags: 01
  221. -- high flags: 0001
  222. -- rect: left=111 top=183 right=205 bottom=148
  223. -- title width / last selected line: 0
  224. -- icon id / first selected line: 0 / 0
  225. -- text alignment: 0
  226. -- font id: 3
  227. -- text size: 12
  228. -- style flags: 0
  229. -- line height: 16
  230. -- part name: Cover 3
  231.  
  232.  
  233. -- part 11 (field)
  234. -- low flags: 01
  235. -- high flags: 0001
  236. -- rect: left=148 top=183 right=205 bottom=183
  237. -- title width / last selected line: 0
  238. -- icon id / first selected line: 0 / 0
  239. -- text alignment: 0
  240. -- font id: 3
  241. -- text size: 12
  242. -- style flags: 0
  243. -- line height: 16
  244. -- part name: Cover 4
  245.  
  246.  
  247. -- part 12 (field)
  248. -- low flags: 01
  249. -- high flags: 0001
  250. -- rect: left=183 top=183 right=205 bottom=208
  251. -- title width / last selected line: 0
  252. -- icon id / first selected line: 0 / 0
  253. -- text alignment: 0
  254. -- font id: 3
  255. -- text size: 12
  256. -- style flags: 0
  257. -- line height: 16
  258. -- part name: Cover 5
  259.  
  260.  
  261. -- part contents for card part 2
  262. ----- text -----
  263. fish
  264. frog
  265. deer
  266. rabbit
  267. whale
  268.  
  269.  
  270. -- part contents for card part 3
  271. ----- text -----
  272. Quickly type the Spanish equivalent of the following word (before your time runs out):
  273.  
  274. -- part contents for card part 4
  275. ----- text -----
  276. deer
  277.  
  278. -- part contents for card part 5
  279. ----- text -----
  280. pez
  281. rana
  282. ciervo
  283. conejo
  284. ballena